"use strict";
import { Modal } from "antd";

/*
 * 组件注释
 * create by wuqiong
 * creation time 2021/05/19
 * 相对比较简单的modal
 * */
// interface LabelledValue {
//   title: string;
//   visible: boolean;
//   handleOk: ()=>{};
//   handleCancel: ()：viod=>any;
//   otherProps?: any;
// }
const Index = (props) => {
  const {
    title,
    visible,
    handleOk = () => { },
    handleCancel = () => { },
    wrapClassName,
    ...otherProps
  } = props;

  return (
    <Modal
      title={title}
      visible={visible}
      onOk={handleOk}
      onCancel={handleCancel}
      destroyOnClose
      wrapClassName={`commonModal ${wrapClassName}`}
      bodyStyle={{
        minHeight: "20vh",
        maxHeight: "48vh",
        overflow: "auto",
        ...!otherProps.footer ? { paddingBottom: 20 } : { marginBottom: 20 }
      }}
      {...otherProps}
    >
      {props.children}
    </Modal>
  );
};
export default Index;
